package com.mark.conf;

import com.mark.web.data.controller.common.SessionExpireFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.servlet.Filter;

/**
 * @Description: 自动配置filter
 * @Author: Mark
 * @CreateDate: 2018/7/4.
 * @Version: 2.0
 * @Copyright : 豆浆油条个人非正式工作室
 */
@Configuration
public class MyFilter  {
    @Bean
    public FilterRegistrationBean sessionExpireFilter(){
        FilterRegistrationBean registrationBean = new FilterRegistrationBean();
        registrationBean.setFilter(this.SessionExpireFilter());
        registrationBean.addUrlPatterns("/*");
        return registrationBean;
    }

    @Bean
    public Filter SessionExpireFilter() {
        return new SessionExpireFilter();
    }
}
